package sim;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Stack;

import matrics.SparseVector;
import myLucene.GetTime;
import myLucene.Props;
import myLucene.SerializeSparseVectorArray;

import prepro.SerializeStopWordObject;
import prepro.SerializeTermsToInt;

public class MakeDistObjects {

	/**
	 * @param args
	 * @throws Exception
	 */
	public static SparseVector[] makeDistVector(LinkedList<Integer>[] ll) throws Exception {
		// TODO Auto-generated method stub


			Stack<Integer> stops = SerializeStopWordObject.deserializeStops();

		
				long start = System.currentTimeMillis();
				SparseVector[] spArrayNew = new SparseVector[Props.dictSize];
				
				int nextStop = stops.peek();
				for (int i = 0; i < ll.length; i++) {
					if (nextStop == i) {
						spArrayNew[i] = new SparseVector(Props.windowSize
								/ Props.distanceSectionsLength);
					} else {
						spArrayNew[i] = DistVector.distToSparseVectors(ll[i]);
						
					}
				}
				
				System.out
						.println("Time needed for computation: "
								+ GetTime.getDuration(start, System
										.currentTimeMillis()));

				System.out
						.println(GetTime.getDuration(start, System
								.currentTimeMillis())
								+ " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
			return spArrayNew;

		}
	}
